#include "trajectory_planning.h"

unsigned long
calculate_params(struct x_trapezoidal_speed *params)
{
    /*
                    v_max
    rising_time = ------------
                    a_max
                    path_length*a_max + v_max^2
    total_time  = -------------------------------
                        a_max*v_max
    */
    unsigned long tmp;
    if ( !(params->a_max) || !(params->v_max) {
        return (1);
    }

    tmp = (params->path_length * params->a_max + params->v_max * params->v_max) \
                /(params->a_max * params->v_max);

    if ( ( params->total_time > 0) && (tmp > params->total_time) ) {
        /* unexpect value */
        return (1);
    } else {
        
    }
}